public class SteingDemo11 {
    public static void main(String[] args) {
        String s1="abcda";
        String s2="cdab";
        for(int i=0;i<s1.length();i++){
            s1=xuanzhuan(s1);
            System.out.println(s1);
            if(s1.equals(s2)){
                System.out.println("相同");
                return;
            }
        }
        System.out.println("不相同");
    }

    public static String xuanzhuan(String s){
        char c=s.charAt(0);
        s=s.substring(1);
        s+=c;
        return s;
    }
}
